Skip to content

fix(ios): handle location watch callbacks recovery after backgrounding#30

Merged
ItsChaceD merged 3 commits into
mainfrom
fix/ios-location-watch-backgrounding
Jun 25, 2025
Merged

fix(ios): handle location watch callbacks recovery after backgrounding#30
ItsChaceD merged 3 commits into
mainfrom
fix/ios-location-watch-backgrounding

Conversation

@ItsChaceD

Copy link
Copy Markdown
Contributor

Description

Fixes #19

This PR fixes iOS watchPosition recovery after backgrounding the app. Previously the plugin would throw an error and stop monitoring location updates. Now it will handle the error gracefully and restart the monitoring when the app becomes active again.

Context

#19

Type of changes

  • Fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Refactor (cosmetic changes)
  • Breaking change (change that would cause existing functionality to not work as expected)

Platforms affected

  • Android
  • iOS
  • JavaScript

Tests

Tested with https://github.com/nharrer/ionic-geo-location

@ItsChaceD
ItsChaceD requested review from a team June 9, 2025 14:09
@alexgerardojacinto

Copy link
Copy Markdown
Contributor

Still have to review the changes themselves, but would this same fix also make sense for the Cordova plugin?

Comment thread packages/capacitor-plugin/ios/Sources/GeolocationPlugin/GeolocationPlugin.swift Outdated
Comment thread packages/capacitor-plugin/ios/Sources/GeolocationPlugin/GeolocationPlugin.swift Outdated
@ItsChaceD

Copy link
Copy Markdown
Contributor Author

Still have to review the changes themselves, but would this same fix also make sense for the Cordova plugin?

Yes it probably makes sense to also make this change to the Cordova plugin since the same issue exists

@ItsChaceD
ItsChaceD merged commit 978bd50 into main Jun 25, 2025
6 checks passed
@OS-pedrogustavobilro
OS-pedrogustavobilro deleted the fix/ios-location-watch-backgrounding branch August 13, 2025 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7.1.1 Watch location stops

4 participants